<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>在从某个文件读取的整个数据集上训练一段时间。</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.fann-train-on-data.html">« fann_train_on_data</a></li>
      <li style="float: right;"><a href="function.fann-train.html">fann_train »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.fann.html">Fann 函数</a></li>
    <li>在从某个文件读取的整个数据集上训练一段时间。</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.fann-train-on-file" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">fann_train_on_file</h1>
  <p class="verinfo">(PECL fann &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">fann_train_on_file</span> &mdash; <span class="dc-title">在从某个文件读取的整个数据集上训练一段时间。</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.fann-train-on-file-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>fann_train_on_file</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">resource</span> <code class="parameter">$ann</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$filename</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$max_epochs</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$epochs_between_reports</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">float</span> <code class="parameter">$desired_error</code></span><br>): <span class="type">bool</span></div>

  <p class="para rdfs-comment">
   在从某个文件读取的整个数据集上训练一段时间。
  </p>
  <p class="para">
   该训练使用 <span class="function"><a href="function.fann-set-training-algorithm.html" class="function">fann_set_training_algorithm()</a></span> 函数选择的算法和这些训练算法设置的参数。
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-function.fann-train-on-file-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">ann</code></dt>

    <dd>

     <p class="para">神经网络 <span class="type"><span class="type 资源">资源</span></span>。</p>
    </dd>

   
   
    <dt>
<code class="parameter">filename</code></dt>

    <dd>

     <p class="para">
      包含训练数据的文件。
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">max_epochs</code></dt>

    <dd>

     <p class="para">
      训练应该继续的最大周期数。
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">epochs_between_reports</code></dt>

    <dd>

     <p class="para">
      用户函数之间的周期数。当为0时表示没有用户函数被调用。
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">desired_error</code></dt>

    <dd>

     <p class="para">
      期望的是 <span class="function"><a href="function.fann-get-mse.html" class="function">fann_get_MSE()</a></span> 或 <span class="function"><a href="function.fann-get-bit-fail.html" class="function">fann_get_bit_fail()</a></span>的返回值, 取决于 <span class="function"><a href="function.fann-set-train-stop-function.html" class="function">fann_set_train_stop_function()</a></span> 选择的停止函数。
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.fann-train-on-file-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">成功时返回 <strong><code>true</code></strong>，其它情况下返回 <strong><code>false</code></strong>。</p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.fann-train-on-file-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.fann-train-on-data.html" class="function" rel="rdfs-seeAlso">fann_train_on_data()</a> - 在整个数据集上训练一段时间。</span></li>
    <li class="member"><span class="function"><a href="function.fann-train-epoch.html" class="function" rel="rdfs-seeAlso">fann_train_epoch()</a> - 使用一组训练数据训练一个周期。</span></li>
    <li class="member"><span class="function"><a href="function.fann-get-bit-fail.html" class="function" rel="rdfs-seeAlso">fann_get_bit_fail()</a> - 失败位的数量</span></li>
    <li class="member"><span class="function"><a href="function.fann-get-mse.html" class="function" rel="rdfs-seeAlso">fann_get_MSE()</a> - 从网络中读取均方误差。</span></li>
    <li class="member"><span class="function"><a href="function.fann-set-train-stop-function.html" class="function" rel="rdfs-seeAlso">fann_set_train_stop_function()</a> - 设置训练期间使用的停止函数。</span></li>
    <li class="member"><span class="function"><a href="function.fann-set-training-algorithm.html" class="function" rel="rdfs-seeAlso">fann_set_training_algorithm()</a> - 设置训练算法。</span></li>
    <li class="member"><span class="function"><a href="function.fann-set-callback.html" class="function" rel="rdfs-seeAlso">fann_set_callback()</a> - 设置训练期间使用的回调函数。</span></li>
   </ul>
  </p>
 </div>



</div></div></div></body></html>